package com.online.service.impl;

import com.online.entity.JudgeQuestion;
import com.online.mapper.JudgeQuestionMapper;
import com.online.service.JudgeQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JudgeQuestionServiceImpl implements JudgeQuestionService {
    @Autowired
    private JudgeQuestionMapper judgeQuestionMapper;
    /**
     * 增加判断题
     * @param judgeQuestion
     * @return
     */
    @Override
    public int add(JudgeQuestion judgeQuestion) {
        return judgeQuestionMapper.add(judgeQuestion);
    }

    /**
     * 查询最后一条记录的questionId
     * @return
     */
    @Override
    public JudgeQuestion findOnlyQuestionId() {
        return judgeQuestionMapper.findOnlyQuestionId();
    }

    @Override
    public List<JudgeQuestion> findByIdAndType(Integer paperId) {
        return judgeQuestionMapper.findByIdAndType( paperId);
    }

    @Override
    public List<Integer> findBySubject(String subject, Integer judgeNumber) {
        return judgeQuestionMapper.findBySubject(subject,judgeNumber);
    }
}
